package cn.gs.utils;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {
	private HibernateUtil(){}
	private static final SessionFactory  factory;
	private static final Configuration configuration;
	
	static{
		configuration=new Configuration().configure();
		factory=configuration.buildSessionFactory();		
	}
	public  static Session openSession() {
		return factory.openSession();
	}
		
}
